package bestTeam.WalkieDoggie.server.Persistant;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import bestTeam.WalkieDoggie.client.Gender;
import bestTeam.WalkieDoggie.client.Serializables.UserProfileData;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class AppUser {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private String uid;
	@Persistent
	private String nickName;
	@Persistent
	private double lat;
	@Persistent
	private double lng;
	@Persistent
	private String city;
	@Persistent
	private String street;
	@Persistent
	private String houseNumber;
	@Persistent
	private String Phone;
	@Persistent
	private String dogName;
	@Persistent
	private Gender dogGender;
	@Persistent
	private boolean OKwithOtherMales;
	@Persistent
	private boolean OKwithOtherFemales;
	@Persistent
	private Integer credit;
	@Persistent
	private double ranking;
	@Persistent
	private Integer numberOfRankers;
	@Persistent
	private String FBprofileLink;
	@Persistent
	private String[] FBFriends_id;
	@Persistent
	private String[] FBFriends_name;
	@Persistent
	private String[] FBFriends_link;
	public String[] getFBFriends_id() {
		return FBFriends_id;
	}


	public void setFBFriends_id(String[] fBFriends_id) {
		FBFriends_id = fBFriends_id;
	}


	public String[] getFBFriends_name() {
		return FBFriends_name;
	}


	public void setFBFriends_name(String[] fBFriends_name) {
		FBFriends_name = fBFriends_name;
	}


	public String[] getFBFriends_link() {
		return FBFriends_link;
	}


	public void setFBFriends_link(String[] fBFriends_link) {
		FBFriends_link = fBFriends_link;
	}

	@Persistent
	private String Email;
	@Persistent
	private Boolean wantEmails;

	//	@Persistent
	//	private PersistantRequest[] volunteeredFor;



	public String getFBprofileLink() {
		return FBprofileLink;
	}


	public void setFBprofileLink(String fBprofileLink) {
		FBprofileLink = fBprofileLink;
	}


	public AppUser(UserProfileData userData) {
		
		this.credit = userData.getCredit();

		this.numberOfRankers = 0;
		this.ranking = userData.getRanking();
		this.city = userData.getCity();
		this.dogName = userData.getDogName();
		this.dogGender = userData.getDogGender();
		this.OKwithOtherFemales = userData.getOKwithFemales();
		this.OKwithOtherMales = userData.getOKwithMales();
		this.houseNumber = userData.getHouseNumber();
		this.Phone = userData.getPhone();
		this.street = userData.getStreet();
		this.uid = userData.getId();
		this.nickName = userData.getNickName();
		this.Email=userData.getEmail();
		this.wantEmails=userData.getWantDailyEmails(); 
		this.FBprofileLink = userData.getFBprofileLink();
		
		if(userData.getGeoLocation()!=null){

			this.lat = userData.getGeoLocation().getLat();
			this.lng = userData.getGeoLocation().getLng();
		}
		
		
	}


	public String getUserId() {
		return uid;
	}
	public void setUserId(String uid) {
		this.uid = uid;
	}
	public String getPhone() {
		return Phone;
	}
	public void setPhone(String phone) {
		Phone = phone;
	}
	public String getUid() {
		return uid;
	}
	public void setUid(String uid) {
		this.uid = uid;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getStreet() {
		return street;
	}
	public void setStreet(String street) {
		this.street = street;
	}
	public String getHouseNumber() {
		return houseNumber;
	}
	public void setHouseNumber(String houseNumber) {
		this.houseNumber = houseNumber;
	}
	public String getDogName() {
		return dogName;
	}
	public void setDogGender(Gender dogGender) {
		this.dogGender = dogGender;
	}
	public Gender getDogGender() {
		return dogGender;
	}
	public void setDogName(String dogName) {
		this.dogName = dogName;
	}
	public boolean getOKwithOtherMales() {
		return OKwithOtherMales;
	}
	public void setOKwithOtherMales(boolean OKwithOtherMales) {
		this.OKwithOtherMales = OKwithOtherMales;
	}
	public boolean getOKwithOtherFemales() {
		return OKwithOtherFemales;
	}
	public void setOKwithOtherFemales(boolean OKwithOtherFemales) {
		this.OKwithOtherFemales = OKwithOtherFemales;
	}
	public Integer getCredit() {
		return credit;
	}
	public void setCredit(Integer credit) {
		this.credit = credit;
	}


	//	public PersistantRequest[] getVolunteeredFor() {
	//		return volunteeredFor;
	//	}
	//	public void setVolunteeredFor(PersistantRequest[] volunteeredFor) {
	//		this.volunteeredFor = volunteeredFor;
	//	}
	public String getNickName() {
		return nickName;
	}


	public void setNickName(String nickName) {
		this.nickName = nickName;
	}


	public double getLat() {
		return lat;
	}


	public void setLat(double lat) {
		this.lat = lat;
	}


	public double getLng() {
		return lng;
	}


	public void setLng(double lng) {
		this.lng = lng;
	}


	public double getRanking() {
		return ranking;
	}


	public void setRanking(double ranking) {
		this.ranking = ranking;
	}


	public Integer getNumberOfRankers() {
		return numberOfRankers;
	}


	public void setNumberOfRankers(Integer numberOfRankers) {
		this.numberOfRankers = numberOfRankers;
	}
	
	public String getEmail() {
		
		return this.Email;
	}

	public void setEmail(String email) {
		Email = email;
	}

	public Boolean getWantEmails() {
		return wantEmails;
	}


	public void setWantEmails(Boolean wantEmails) {
		this.wantEmails = wantEmails;
	}


}
